package org.stone.project.ncCheck.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.stone.project.ncCheck.domain.UserInfo;
import org.stone.project.ncCheck.service.MsgSender;
import org.stone.project.ncCheck.service.UserInfoService;
import org.stone.project.ncCheck.mapper.UserInfoMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
    implements UserInfoService{
    @Autowired
    private MsgSender msgSender;

    @Override
    public void sendAllMsg(String msg) {
        List<UserInfo> userInfos = this.baseMapper.selectList(null);
        for (UserInfo userInfo : userInfos) {
            msgSender.send(msg,userInfo.getEmail());
        }
    }
}




